import service from ".";
import qs from 'qs';

const adminApi = {


    longinfo() {
        return service.get('/admin/info/adminInfo');
    },
    top5() {
        return service.get('/admin/info/top5');
    },
    top6() {
        return service.get('/admin/info/top6');
    },

    lgoin(admin) {
        return service.post("/login", qs.stringify(admin));
    },
    //验证码
    captcha() {
        return service.get("/captcha");
    },
    insert(admin) {
        //发送axios请求
        return service.post('/login/insert', admin);
    },
    //删除
    delete(id) {
        return service.delete(`/admin/adminuser/${id}`);
    },
    //修改
    update(admin) {
        //发送axios请求
        return service.put('/admin/adminuser', admin);
    },
    //查询所有
    selectPage(pageNum, uname) {
        //发送axios请求
        return service.get('/admin/adminuser', {
            params: {
                pageNum,
                uname
            }

        });
    },
    //根据id进行查询
    selectById(id) {
        return service.get(`/admin/adminuser/${id}`);
    }

};



export default adminApi;